<!DOCTYPE HTML>
<html>

<head>
   <title>新增帖子</title>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <link href="../../../assets/css/dpl-min.css" rel="stylesheet" type="text/css" />
   <link href="../../../assets/css/bui-min.css" rel="stylesheet" type="text/css" />
   <link href="../../../assets/css/page-min.css" rel="stylesheet" type="text/css" />
   <link href="../../../assets/js/kindeditor/themes/default/default.css" rel="stylesheet" type="text/css" />
   <link href="../../../assets/css/jx-style.css" rel="stylesheet" type="text/css" />
   <link href="../../../assets/css/prettify.css" rel="stylesheet" type="text/css" />
   <link href="../../../assets/css/my-style.css" rel="stylesheet" type="text/css" />
   <link href="../../../assets/css/fileinput.min.css" rel="stylesheet" type="text/css" />
</head>

<body>
   <div class="container">
      <div class="detail-page  ">
         <div class="detail-page-title">
            <h4>新增帖子
               <div class="pull-right">
                  <a type="button" class="page-action jx-btn" data-type="close" href="#">返回</a>
               </div>
            </h4>
         </div>
         <div class="detail-section">
            <div class="detail-row">
               <form id="form" class="jx-form form-horizontal">
                  <div id="tab"></div>
                  <div id="panel" class="tab-panel">
                     <div class="panel-item">
                        <div class="row">
                           <div class="control-group">
                              <label for="" class="control-label">商户:
                                    </label>
                              <div class="controls">
                                 <select class="">
                                    <option value="">请选择</option>
                                    <option value="">激想体育特卖号</option>
                                  </select>
                              </div>
                           </div>
                        </div>
                        <div class="row">
                           <div class="control-group">
                              <label for="" class="control-label">帖子标签:
                                    </label>
                              <div class="con-box">
                                 <div class="controls">
                                    <span>美容美发</span><br>
                                    <span class="label ">化妆品</span>
                                    <span class="label ">美发</span>
                                    <span class="label ">美体</span>
                                 </div><br>
                                 <div class="controls">
                                    <span>饮食</span><br>
                                    <span class="label ">本土特产</span>
                                    <span class="label ">境外美食</span>
                                    <span class="label ">生鲜</span>
                                 </div>
                              </div>
                           </div>
                        </div>

                     </div>
                     <!--item end-->
                     <div class="panel-item">
                        <div class="row">
                           <div class="control-group">
                              <label for="" class="control-label">标题:
                                    </label>
                              <div class="controls">
                                 <input type="text" class="input-xlarge" placeholder="请输入标题">
                              </div>
                           </div>
                        </div>

                        <div class="row">
                           <div class="control-group">
                              <label for="" class="control-label has-note">封面图:
                                        <div class="label-note"> 建议尺寸：<br>
                                            750*400px
                                        </div>
                                    </label>
                              <div class="controls">
                                 <input type="file" class="hide">
                                 <a href="#" class="btn-upload" style="width:225px;height:120px;line-height:120px;">
                                    <span>上传图片</span>
                                    <img src="" style="display:none" width="225" height="120">
                                 </a>
                              </div>

                           </div>
                        </div>
                        <div class="row">
                           <div class="control-group">
                              <label for="" class="control-label has-note">封面图:
                                        <div class="label-note"> 建议尺寸：<br>
                                            750*400px
                                        </div>
                                    </label>
                              <div class="controls">
                                 <input type="file" class="hide">
                                 <a href="#" class="btn-upload">
                                    <span>上传图片</span>
                                    <img src="" style="display:none" width="98" height="98">
                                 </a>
                              </div>

                           </div>
                        </div>
                        <div class="row">
                           <div class="control-group">
                              <label for="" class="control-label">帖子内容：
                                    </label>
                              <textarea id="editor_id" name="content" style="width:700px;height:300px;">
                                    &lt;strong&gt;HTML内容&lt;/strong&gt;
                              </textarea>
                           </div>
                        </div>
                     </div>
                     <!--item end-->
                     <div class="panel-item">
                        <div class="row">
                           <div class="control-group">
                              <label for="" class="control-label">状态：
                                    </label>
                              <div class="testswitch">
                                 <input class="testswitch-checkbox" id="onoffswitch" type="checkbox">
                                 <label class="testswitch-label" for="onoffswitch">  
                                          <span class="testswitch-inner" data-on="ON" data-off="OFF"></span>  
                                          <span class="testswitch-switch"></span>  
                                    </label>
                              </div>
                           </div>
                        </div>
                        <div class="share">
                           <div class="row">
                              <div class="control-group">
                                 <label class="control-label">分享简述：</label>
                                 <div class="controls  control-row4"><textarea style="width:500px;height:150px;"></textarea></div>
                              </div>
                           </div>
                           <div class="row">
                              <div class="control-group">
                                 <label class="control-label">显示模式：</label>
                                 <div class="controls">
                                    <label class="span3">
                                        <input type="radio" name="module" class="nine-radio" checked="checked"/>九宫格模式</label>
                                    <label class="span3">
                                        <input type="radio" name="module" class="video-radio"/>视频模式</label>
                                 </div><br>
                              </div>
                              <div class="nine-share">
                                 <button class="batch-upload btn-info btn-xlarge">批量上传</button>
                                 <div class="control-group">
                                    <div class="controls span24 " id="">
                                       <div class="upload-img-unit">
                                          <ul id="upload-pro-img" class="upload-img ">
                                             <li>
                                                <input type="file" class="hide">
                                                <a href="#" class="btn-upload">
                                                            <span>上传图片</span>
                                                            <img src="" width="98" style="display:none" height="98">
                                                      </a>
                                                <a class="upload-del">删除</a>
                                             </li>
                                             <li>
                                                <input type="file" class="hide">
                                                <a href="#" class="btn-upload">
                                                            <span>上传图片</span>
                                                            <img src="" width="98" style="display:none" height="98">
                                                      </a>
                                                <a class="upload-del">删除</a>
                                             </li>
                                             <li>
                                                <input type="file" class="hide">
                                                <a href="#" class="btn-upload">
                                                            <span>上传图片</span>
                                                            <img src="" width="98" style="display:none" height="98">
                                                      </a>
                                                <a class="upload-del">删除</a>
                                             </li>
                                             <li>
                                                <input type="file" class="hide">
                                                <a href="#" class="btn-upload">
                                                            <span>上传图片</span>
                                                            <img src="" width="98" style="display:none" height="98">
                                                      </a>
                                                <a class="upload-del">删除</a>
                                             </li>
                                             <li>
                                                <input type="file" class="hide">
                                                <a href="#" class="btn-upload">
                                                            <span>上传图片</span>
                                                            <img src="" width="98" style="display:none" height="98">
                                                      </a>
                                                <a class="upload-del">删除</a>
                                             </li>
                                             <li>
                                                <input type="file" class="hide">
                                                <a href="#" class="btn-upload">
                                                            <span>上传图片</span>
                                                            <img src="" width="98" style="display:none" height="98">
                                                      </a>
                                                <a class="upload-del">删除</a>
                                             </li>
                                             <li>
                                                <input type="file" class="hide">
                                                <a href="#" class="btn-upload">
                                                            <span>上传图片</span>
                                                            <img src="" width="98" style="display:none" height="98">
                                                      </a>
                                                <a class="upload-del">删除</a>
                                             </li>
                                             <li>
                                                <input type="file" class="hide">
                                                <a href="#" class="btn-upload">
                                                            <span>上传图片</span>
                                                            <img src="" width="98" style="display:none" height="98">
                                                      </a>
                                                <a class="upload-del">删除</a>
                                             </li>
                                             <li>
                                                <input type="file" class="hide">
                                                <a href="#" class="btn-upload">
                                                            <span>上传图片</span>
                                                            <img src="" width="98" style="display:none" height="98">
                                                      </a>
                                                <a class="upload-del">删除</a>
                                             </li>
                                          </ul>
                                          <button type="button" id="add-img" class="add-img-btn jx-btn btn-default hide">+添加图片</button>
                                          <div class="tips">
                                             <span>备注：</span>
                                             <p>选择九宫格模式，至少上传1张图片，最多上传9张图片</p>
                                             <p>鼠标移动至上传的图片，显示【更改图片】和【删除】功能，点击【更改图片】可替换图片</p>
                                             <p>上传图片大小控制在600*600px</p>
                                          </div>
                                          <!--<button type="button" id="add-img" class="add-img-btn jx-btn btn-default">+添加图片</button>-->
                                       </div>
                                    </div>
                                 </div>
                              </div>
                              <div class="video-share">
                                 <div class="form-group">
                                    <input id="file-3" type="file" multiple=true>
                                 </div>
                              </div>
                           </div>
                        </div>
                     </div>
                     <div class="panel-item">
                        <div class="detail-page-title">
                           <h4>商品信息
                              <span id="del-all-btn" class="jx-btn btn-default pull-right">批量删除</span>
                              <span id="add-new-btn" class="jx-btn btn-default pull-right" style="margin-right:30px;">添加商品</span>
                           </h4>
                        </div>
                        <div class="grid-container">
                           <div id="grid"></div>
                        </div>
                     </div>
                     <div class="panel-item">
                        <div class="row">
                           <div class="control-group">
                              <div class="tip">备注：帖子内容审核周期24小时，活动帖请根据活动时间提前准备</div>
                           </div>
                        </div>
                        <div class="row">
                           <div class="control-group">
                              <label class="control-label">帖子类型：</label>
                              <div class="controls">
                                 <label class="span3"><input type="radio" name="module" class="normal-radio" checked/>普通</label>&nbsp;&nbsp;&nbsp;
                                 <label class="span3"><input type="radio" name="module" class="time-limit-radio"/>限时活动</label>
                              </div>
                           </div>
                           <div class="time-limit">
                              <p>限时活动帖，活动结束后帖子自动下架</p>
                              <div class="control-group">
                                 <label class="control-label">活动开始时间：</label>
                                 <div class="controls">
                                    <input class="calendar calendar-time" type="text" name="startTime" id="startTime">
                                 </div>
                              </div>
                              <div class="control-group">
                                 <label class="control-label">活动结束时间：</label>
                                 <div class="controls">
                                    <input class="calendar calendar-time" type="text" name="endTime" id="endTime">
                                 </div>
                              </div>
                           </div>
                        </div>
                        <div class="row">
                           <div class="control-group">
                              <label for="" class="control-label">更多优惠：
                                                </label>
                              <div class="testswitch">
                                 <input class="testswitch-checkbox" id="onoffswitch2" type="checkbox">
                                 <label class="testswitch-label" for="onoffswitch2">  
                                                      <span class="testswitch-inner" data-on="ON" data-off="OFF"></span>  
                                                      <span class="testswitch-switch"></span>  
                                                </label>
                              </div>
                           </div>
                           <div class="discount">
                              <label for="" class="control-label">优惠类型：
                                                </label>
                              <div class="controls">
                                 <select class="">
                                                  <option value="">满减优惠</option>
                                              </select>
                              </div><br>
                              <p>在此帖子内消费下单满指定金额，享受此优惠。<br> 不同帖子的商品消费金额不能共享
                              </p>
                              <p style="color:#333;">此帖消费金额满
                                 <input type="text" class="input-small">元，立减
                                 <input type="text" class="input-small">元</p>
                           </div>
                        </div>
                     </div>
                  </div>
               </form>
            </div>
         </div>
         <div class="row" style="margin-left:123px;">
            <div class="span3">
               <button class="jx-btn btn-default btn-xlarge btn-block">提交审核</button>
            </div>
            <div class="span3">
               <button class="jx-btn btn-default btn-xlarge btn-block">保存</button>
            </div>
            <img src="" alt="">
         </div>

      </div>

   </div>
   <!-- 初始隐藏 remakesDialog内容 -->
   <div id="product" class="hide">
      <form class="form-horizontal">
         <div id="productform" class="row">
            <div class="control-group span7" style="margin-bottom:10px;">
               <span>商品名：</span>
               <input type="text" class="control-text" name="code" id="goodsName">
            </div>
            <div class="control-group span7" style="margin-bottom:10px;">
               <span>商品编码：</span>
               <input type="text" class="control-text" name="code" id="goodsCode">
            </div>
            <div class="control-group span11" style="margin-bottom:10px;">
               <span>创建时间：</span>
               <input class="calendar calendar-time" type="text" name="startTime" id="startTime"><span> &nbsp;-&nbsp; </span>
               <input class="calendar calendar-time" type="text" name="endTime" id="endTime">
            </div>
            <div class="control-group span7" style="margin-bottom:10px;">
               <span>库存量：</span>
               <select id="goodsStatus" name="">
                        <option value="">全部</option>
                        <option value="1">有货</option>
                        <option value="0">售罄</option>
                  </select>
            </div>
            <div class="span2 pull-right">
               <button type="submit" id="btnSearch" class="jx-btn btn-default">搜索</button>
            </div>
            <div id="dialoggrid" style="margin-top:70px;"></div>
         </div>
      </form>
   </div>

   <script type="text/javascript" src="../../../assets/js/jquery-1.8.1.min.js"></script>
   <script type="text/javascript" src="../../../assets/js/bootstrap.js"></script>
   <script type="text/javascript" src="../../../assets/js/bui-min.js"></script>
   <script type="text/javascript" src="../../../assets/js/config-min.js"></script>
   <script type="text/javascript" src="../../../assets/js/admin.js"></script>
   <script type="text/javascript" src="../../../assets/js/Sortable.min.js"></script>
   <script type="text/javascript" src="../../../assets/js/kindeditor/kindeditor-all-min.js"></script>
   <script type="text/javascript" src="../../../assets/js/kindeditor/zh-CN.js"></script>
   <script type="text/javascript" src="../../../assets/js/fileinput.min.js"></script>
   <script type="text/javascript" src="../../../assets/js/zh.js"></script>
   <script type="text/javascript">
      KindEditor.ready(function (K) {
         window.editor = K.create('#editor_id');
      });
      $("#file-3").fileinput({
         showUpload: false,
         showCaption: false,
         browseClass: "video-upload btn btn-primary btn-lg",
         fileType: "any",
         browseLabel: '上传视频',
         removeLabel: '删除视频'
      });
      //点击添加规格
      $(document).on("click", "#add-size", function () {
         var str = '<tr>' +
            '           <td> <input class="input-medium" type="text"></td>' +
            '           <td> <input class="input-medium" type="text"></td>' +
            '           <td class="td-price"> <input class="input-medium" type="text"></td>' +
            '           <td class="td-stock"> <input class="input-medium" type="text"></td>' +
            '           <td> <input class="input-medium" type="text"></td>' +
            '           <td> <input class="input-medium" type="text"></td>' +
            '           <td class="td-ratio-price" width="100"> </td>' +
            '           <td width="100"> <a class="del-size" href="javascript:void(0);">删除</a></td>' +
            '       </tr>'
         $("#size-table tbody").append(str);

      })
      $('.label').click(function () {
         $(this).toggleClass('label-info')
      })
      // on-off 按钮
      $("#onoffswitch").on('click', function () {
         clickSwitch()
      });
      $("#onoffswitch2").on('click', function () {
         if ($("#onoffswitch2").is(':checked')) {
            $('.discount').show()
         } else {
            $('.discount').hide()
         }
      });
      var clickSwitch = function () {
         if ($("#onoffswitch").is(':checked')) {
            $('.share').show()
         } else {
            $('.share').hide()
         }
      };
      // radio按钮
      $('.nine-radio').on('click', function () {
         $('.nine-share').show();
         $('.video-share').hide();
      });
      $('.video-radio').on('click', function () {
         $('.nine-share').hide();
         $('.video-share').show();
      });
      $('.normal-radio').on('click', function () {
         $('.time-limit').hide();
      });
      $('.time-limit-radio').on('click', function () {
         $('.time-limit').show();
      });
      //计算返佣金额
      $(document).on("blur", "#price-ratio", function () {

         // 重新计算
         calculate();
      });


      function calculate() {
         var minArr = [];
         var totalStock = 0;
         var minPrice = "0.00";
         $("#size-table tbody tr").each(function () {
            var _this = $(this);
            var price = parseFloat(_this.find(".td-price input").val());
            var stock = _this.find(".td-stock input").val();
            var ratioPrice = _this.find(".td-ratio-price");
            var ratio = parseInt($("#price-ratio").val());
            //价格
            if (!isNaN(price)) {
               minArr.push(price);
            }
            //库存
            if (stock != "") {
               totalStock += parseInt(stock);
            }
            //返佣金额
            if (!isNaN(ratio) && !isNaN(price)) {
               var text = price * ratio * 0.01;
               ratioPrice.text(text.toFixed(2))
            }
         });
      }
   </script>


   <script type="text/javascript">
      var el = document.getElementById('upload-pro-img');
      var sortable = Sortable.create(el, {
         filter: ".ignore-element", //selector 格式为简单css选择器的字符串，定义哪些列表单元不能进行拖放，可设置为多个选择器，中间用“，”分隔；
         onEnd: function ( /**Event*/ evt) {
            evt.oldIndex; // element's old index within parent
            evt.newIndex; // element's new index within parent
         },
         // Changed sorting within list
         onUpdate: function ( /**Event*/ evt) {
            var itemEl = evt.item; // dragged HTMLElement
            // + indexes from onEnd
         },
      });
      //点击添加图片
      $(document).on("click", "#add-img", function () {
         var str = '<li>' +
            '           <input type="file" class="hide">' +
            '           <a href="#" class="btn-upload">' +
            '               <span>上传图片</span>' +
            '               <img src="" width="98" style="display:none" height="98"  >' +
            '           </a>' +
            '           <a class="upload-del">删除</a>' +
            '        </li>'
         $("#upload-pro-img").append(str);
         //最多八个
         var count = $("#upload-pro-img").find("li").length;
         if (count >= 9) {
            $(".add-img-btn").hide();
         }
      })
      //删除图片
      $(document).on("click", ".upload-del", function () {
         $(this)
            .parent()
            .remove();
         var count = $("#upload-pro-img").find("li").length;
         //七个的时候显示添加图片按钮
         if (count == 8) {
            $(".add-img-btn").show();
         }
      });
   </script>
   <script type="text/javascript">
      BUI.use(['bui/grid', 'bui/data', 'common/search'], function (Grid, Data, Search) {
         var Grid = Grid,
            Store = Data.Store,
            columns = [{
               title: '商品信息',
               dataIndex: 'a',
               elCls: 'td-pro',
               width: 250,
               renderer: function (value, obj) {
                  return '<div class="td-inner">' +
                     '  <img class="pro-img"   src="../../../assets/img/u9486.png" alt="">' +
                     '  <div class="pro-info  ml-10">' +
                     '      <p>DIADORA/迪亚多纳 女子小童跑步鞋 17036350160</p>' +
                     '      <p>返佣比例：40%</p>' +
                     '  </div>' +
                     '</div>'
               }
            }, {
               title: '规格',
               dataIndex: 'b',
               elCls: 'center',
               width: 100,
               renderer: function (value, obj) {
                  return '<div>' +
                     '           <p>' + obj.b[0] + '</p>' +
                     '           <p>' + obj.b[1] + '</p>' +
                     '           <p>' + obj.b[2] + '</p>' +
                     '           <p>' + obj.b[3] + '</p>' +
                     '      </div>';
               }
            }, {
               title: '销售价',
               elCls: 'center',
               dataIndex: 'c',
               width: 100,
               renderer: function (value, obj) {
                  return '<div>' +
                     '           <p>' + obj.c[0] + '</p>' +
                     '           <p>' + obj.c[1] + '</p>' +
                     '           <p>' + obj.c[2] + '</p>' +
                     '           <p>' + obj.c[3] + '</p>' +
                     '      </div>';
               }
            }, {
               title: '成本',
               elCls: 'center',
               dataIndex: 'd',
               width: 100,
               renderer: function (value, obj) {
                  return '<div>' +
                     '           <p>' + obj.d[0] + '</p>' +
                     '           <p>' + obj.d[1] + '</p>' +
                     '           <p>' + obj.d[2] + '</p>' +
                     '           <p>' + obj.d[3] + '</p>' +
                     '      </div>';
               }
            }, {
               title: '返佣金额',
               elCls: 'center',
               dataIndex: 'e',
               width: 100,
               renderer: function (value, obj) {
                  return '<div>' +
                     '           <p>' + obj.e[0] + '</p>' +
                     '           <p>' + obj.e[1] + '</p>' +
                     '           <p>' + obj.e[2] + '</p>' +
                     '           <p>' + obj.e[3] + '</p>' +
                     '      </div>';
               }
            }, {
               title: '营收小计（忽略运费）',
               elCls: 'center',
               dataIndex: 'f',
               width: 200,
               renderer: function (value, obj) {
                  return '<div>' +
                     '           <p>' + obj.f[0] + '</p>' +
                     '           <p>' + obj.f[1] + '</p>' +
                     '           <p>' + obj.f[2] + '</p>' +
                     '           <p>' + obj.f[3] + '</p>' +
                     '      </div>';
               }
            }, {
               title: '操作',
               elCls: 'center',
               dataIndex: 'p',
               width: 250,
               renderer: function (value, obj) {
                  var editStr = Search.createLink({ //链接使用 此方式
                        id: 'edit' + obj.id,
                        title: '编辑商品信息',
                        text: '[ 编辑 ] ',
                        href: 'templates/product/product-list/product-add-info.html'
                     }),
                     offStr = '<span class="grid-command btn-del">[ 删除 ]</span>';

                  return editStr + offStr;
               }
            }],
            data = [{
               id: 1,
               a: '商品信息',
               b: [4, 5, 6, 6],
               c: [250.00, 250.00, 250.00, 250.00],
               d: [80.00, 80.00, 80.00, 80.00],
               e: [100.00, 100.00, 100.00, 100.00],
               f: [150.00, 150.00, 150.00, 150.00],
            }];

         //初始化数据
         var store = new Store({ //初始化数据
               data: data,
               autoLoad: true, //自动加载数据
               pageSize: 2 // 配置分页数目
            }),
            grid = new Grid.Grid({
               render: '#grid',
               elCls: 'small-bui-grid-table',
               columns: columns,
               forceFit: true,
               loadMask: true, //加载数据时显示屏蔽层
               // 底部工具栏
               bbar: {
                  // pagingBar:表明包含分页栏
                  pagingBar: true
               },
               plugins: [Grid.Plugins.CheckSelection], //插件
               store: store
            });

         grid.render();
      });
   </script>
   <script type="text/javascript">
      BUI.use('common/page');
      BUI.use(['bui/tab', 'bui/calendar'], function (Tab, Calendar) {
         var datepicker = new Calendar.DatePicker({
            trigger: '.calendar',
            autoRender: true
         });
         var tab = new Tab.TabPanel({
            render: '#tab',
            elCls: 'nav-tabs',
            panelContainer: '#panel', //如果内部有容器，那么会跟标签项一一对应，如果没有会自动生成
            //selectedEvent : 'mouseenter',//默认为click,可以更改事件
            autoRender: true,
            children: [{
               title: '商户分类',
               value: '1',
               selected: true
            }, {
               title: '基础信息',
               value: '2',
            }, {
               title: '九宫格分享',
               value: '3',
            }, {
               title: '商品',
               value: '4',
            }, {
               title: '更多',
               value: '5',
            }]
         });
         tab.on('selectedchange', function (ev) {
            var item = ev.item;

         });
         tab.setSelected(tab.getItemAt(0));

      });
   </script>
   <script type="text/javascript">
      BUI.use(['bui/grid', 'bui/data', 'bui/calendar', 'bui/tab', 'common/search', 'bui/overlay', 'bui/form'], function (
         Grid, Data, Calendar,
         Tab, Search, Overlay, Form) {
         //发货表格
         var dialogStore = Data.Store,
            dialogcolumns = [{
               title: '商品信息',
               dataIndex: 'a',
               elCls: 'td-pro',
               width: 250,
               renderer: function (value, obj) {
                  return '<div class="td-inner">' +
                     '  <img class="pro-img"   src="../../../assets/img/u9486.png" alt="">' +
                     '  <div class="pro-info  ml-10">' +
                     '      <p>DIADORA/迪亚多纳 女子小童跑步鞋 17036350160</p>' +
                     '      <p class="jx-text-error">销售价： ¥49.00</p>' +
                     '  </div>' +
                     '</div>'
               }
            }, {
               title: '返佣金额',
               dataIndex: 'b',
               width: 150,
               renderer: function (value, obj) {
                  return '<div>' +
                     '           <p>返佣金额：￥49.00</p>' +
                     '           <p>比例：20%</p>' +
                     '      </div>';
               }

            }, {
               title: '库存',
               elCls: 'center',
               dataIndex: 'c',
               width: 100
            }, {
               title: '创建时间',
               elCls: 'center',
               dataIndex: 'd',
               width: 150
            }, {
               title: '状态',
               elCls: 'center',
               dataIndex: 'e',
               width: 100,
               renderer: function (value, obj) {
                  return '<div>' +
                     '           <p>上架</p>' +
                     '           <p class="jx-text-error">帖子商品</p>' +
                     '      </div>';
               }
            }, {
               title: '操作',
               elCls: 'center',
               dataIndex: 'p',
               width: 250,
               renderer: function (value, obj) {
                  showStr = Search.createLink({ //链接使用 此方式
                        id: 'edit' + obj.id,
                        title: '预览',
                        text: '[ 预览 ] ',
                        href: 'templates/product/product-list/product-add-info.html'
                     }),
                     addStr = '<span class="grid-command add-btn">[ 添加至帖子 ]</span>'
                  return showStr + addStr;
               }
            }],
            dialogdata = [{
               id: 1,
               a: '商品信息',
               b: '返佣金额',
               c: '4',
               d: '2018-04-03 11:45:01',
               e: '状态'
            }, {
               id: 2,
               a: '商品信息',
               b: '返佣金额',
               c: '4',
               d: '2018-04-03 11:45:01',
               e: '状态'
            }];

         var dialogstore = new dialogStore({
               data: dialogdata,
               autoLoad: true,
               pageSize: 2 // 配置分页数目
            }),
            dialoggrid = new Grid.Grid({
               render: '#dialoggrid',
               forceFit: true, // 列宽按百分比自适应
               elCls: 'small-bui-grid-table mb-20',
               columns: dialogcolumns,
               plugins: [Grid.Plugins.CheckSelection], //插件
               store: dialogstore,
               bbar: {
                  // pagingBar:表明包含分页栏
                  pagingBar: true
               },
            });
         dialoggrid.render();
         //发货
         var salesLogDialog = new Overlay.Dialog({
            title: '商品明细（激想体育特卖号）',
            width: 1100,
            // height: 400,
            //配置DOM容器的编号
            contentId: 'product',
            buttons: [{
               text: '批量添加至帖子',
               elCls: 'button button-primary',
               handler: function () {
                  //do some thing

               }
            }, {
               text: '取消',
               elCls: 'button',
               handler: function () {
                  this.close();
               }
            }]
         });

         $('#btnSearch').on('click', function () {
           
         });

         $('#add-new-btn').on('click', function () {
            salesLogDialog.show();
         });
      });
   </script>

</body>

</html>